package webshop.controller.action;

import webshop.model.bl.CategoryManager;

import com.opensymphony.xwork2.ActionSupport;

public class CategoryAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2010160690105344460L;
	
	private String categoryname;
	
	public String execute() {
		try {
			new CategoryManager().addCategory(categoryname);
		} catch (Throwable ex) {
			addActionError("error.category.create");
		}
		return SUCCESS;
	}
	
	public void setCategoryname(String categoryname) {
		this.categoryname = categoryname;
	}

}
